package testing;
import org.junit.*;

import exceptions.UnDecidibleValueException;

import logicaDePredicados.Pair;
import logicaDePredicados.SkolemFunction;


public class SkolemFunctionTest {
	private SkolemFunction<Pair<String,String>,String> sonOf;
	@Before
	public void setUp (){
		sonOf= new SkolemFunction<Pair<String,String>, String> ("son-of");
		
		sonOf.addValue(new Pair<String,String>("Tom","Susan"), "Timmy");
		sonOf.addValue(new Pair<String,String>("Richard","July"), "Dominic");
		
	}
	@Test
	public void test() throws UnDecidibleValueException {
		Assert.assertNotNull(sonOf);
		Assert.assertEquals("Timmy", sonOf.calculate(new Pair<String,String>("Tom","Susan")));
		Assert.assertEquals("Dominic", sonOf.calculate(new Pair<String,String>("Richard","July")));
		try {
			sonOf.calculate(new Pair<String,String>("Richard","fasdfasdfasdly"));
			
			Assert.fail("no Exception was thrown");
		}catch (UnDecidibleValueException e){
			
		}
	}
	
}
